package com.jsmy.marketing.listener;

import android.content.Context;
import android.widget.Toast;

import com.umeng.socialize.UMShareListener;
import com.umeng.socialize.bean.SHARE_MEDIA;

/**
 * Created by PC_WLT on 2018/4/27.
 */

public class onUMShareActionListener implements UMShareListener {

    private Context mContext;
    public onUMShareActionListener(Context context) {
            this.mContext=context;
    }

    @Override
    public void onStart(SHARE_MEDIA share_media) {

    }

    @Override
    public void onResult(SHARE_MEDIA platform) {
        if (
                platform != SHARE_MEDIA.SMS
                        && platform != SHARE_MEDIA.EMAIL
                        && platform != SHARE_MEDIA.WEIXIN
                        && platform != SHARE_MEDIA.WEIXIN_CIRCLE
                        && platform != SHARE_MEDIA.QQ
                        && platform != SHARE_MEDIA.QZONE
                        && platform != SHARE_MEDIA.SINA
                ) {
            Toast.makeText(mContext, platform + " 分享成功啦", Toast.LENGTH_SHORT).show();
        }

    }

    @Override
    public void onError(SHARE_MEDIA platform, Throwable throwable) {
        if (  platform != SHARE_MEDIA.SMS
                && platform != SHARE_MEDIA.EMAIL
                && platform != SHARE_MEDIA.WEIXIN
                && platform != SHARE_MEDIA.WEIXIN_CIRCLE
                && platform != SHARE_MEDIA.QQ
                && platform != SHARE_MEDIA.QZONE
                && platform != SHARE_MEDIA.SINA) {
            Toast.makeText(mContext, platform + " 分享失败啦", Toast.LENGTH_SHORT).show();

        }
    }

    @Override
    public void onCancel(SHARE_MEDIA platform) {
        Toast.makeText(mContext, platform + " 分享取消了", Toast.LENGTH_SHORT).show();
    }

}
